CREATE TABLE [dbo].[tb_LicenciasHistoricasCert]
(
[idLicenciaHistoricaOLD] [int] NOT NULL IDENTITY(1, 1),
[Agente] [int] NOT NULL,
[OrganizacionHistorica] [int] NOT NULL,
[ConOSinGoce] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FechaAlta] [datetime] NULL,
[Baja] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FechaBaja] [datetime] NULL,
[Dias] [int] NULL,
[Funcion] [int] NULL,
[Organizacion] [int] NULL,
[Modalidad] [int] NULL,
[ClasificacionServCert] [int] NULL CONSTRAINT [DF_tb_LicenciasHistoricasOLD_ClasificacionServCert] DEFAULT ((4)),
[Categoria] [varchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Zona] [int] NULL,
[cargo] [int] NULL,
[FrenteAlumno] [varchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricasCert] ADD CONSTRAINT [PK_tb_LicenciasHistoricasCert] PRIMARY KEY CLUSTERED  ([idLicenciaHistoricaOLD]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricasCert] WITH NOCHECK ADD CONSTRAINT [FK_tb_LicenciasHistoricasCert_tb_Agentes] FOREIGN KEY ([Agente]) REFERENCES [dbo].[tb_Agentes] ([idAgente])
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricasCert] WITH NOCHECK ADD CONSTRAINT [FK_tb_LicenciasHistoricasCert_tb_CargosGenericos] FOREIGN KEY ([cargo]) REFERENCES [dbo].[tb_CargosGenericos] ([idCargoGenerico])
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricasCert] WITH NOCHECK ADD CONSTRAINT [FK_tb_LicenciasHistoricasCert_tb_ClasificacionServCert] FOREIGN KEY ([ClasificacionServCert]) REFERENCES [dbo].[tb_ClasificacionServCert] ([IdClasificacion])
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricasCert] WITH NOCHECK ADD CONSTRAINT [FK_tb_LicenciasHistoricasCert_tb_Funciones] FOREIGN KEY ([Funcion]) REFERENCES [dbo].[tb_Funciones] ([idFuncion]) NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricasCert] WITH NOCHECK ADD CONSTRAINT [FK_tb_LicenciasHistoricasCert_tb_ModalidadesEnsenanza] FOREIGN KEY ([Modalidad]) REFERENCES [dbo].[tb_ModalidadesEnsenanza] ([idModalidad])
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricasCert] WITH NOCHECK ADD CONSTRAINT [FK_tb_LicenciasHistoricasCert_tb_Organizaciones] FOREIGN KEY ([Organizacion]) REFERENCES [dbo].[tb_Organizaciones] ([idOrganizaciones])
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricasCert] WITH NOCHECK ADD CONSTRAINT [FK_tb_LicenciasHistoricasCert_tb_OrganizacionesHistoricas] FOREIGN KEY ([OrganizacionHistorica]) REFERENCES [dbo].[tb_OrganizacionesHistoricas] ([idOrganizacionHistorica])
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricasCert] WITH NOCHECK ADD CONSTRAINT [FK_tb_LicenciasHistoricasCert_tb_Zonas] FOREIGN KEY ([Zona]) REFERENCES [dbo].[tb_Zonas] ([idZona])
GO
